Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JENKINS-68822 added support for removing all builds with LogRotator #9405

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

madisparn
Copy link
Contributor

@madisparn madisparn commented Jun 20, 2024

See JENKINS-68822.

Testing done

Verified configuration in UI
Checked that old configuration is loaded from disk
Run the unit tests

Proposed changelog entries

  • Allow all builds to be removed by the build discarder.

Proposed upgrade guidelines

N/A

Submitter checklist

Before the changes are marked as ready-for-merge:

Maintainer checklist

Copy link

welcome bot commented Jun 20, 2024

Yay, your first pull request towards Jenkins core was created successfully! Thank you so much!

A contributor will provide feedback soon. Meanwhile, you can join the chats and community forums to connect with other Jenkins users, developers, and maintainers.

@timja timja added the rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Jun 21, 2024
@timja timja requested a review from a team June 21, 2024 08:44
Comment on lines 175 to 176
Run lsb = removeLastSuccessfulBuild ? null : job.getLastSuccessfulBuild();
Run lstb = removeLastStableBuild ? null : job.getLastStableBuild();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I think this logic may not be 100% correct.

I have selected "Remove last stable build" - Yes

and then I have a stable build (success) and 2 failures.

My stable build never gets removed because I have set Remove last successful build - no.

The UI seems to be a bit too tied to the implementation.

At a minimum I think if remove last stable build is selected as yes and the last successful build is a stable build then it should be removed.


I wonder if we need both UI options, would it be enough to just add the stable option?

Or do you have any ideas on how it could be simpler?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, having a single UI setting is simpler.

@@ -41,5 +41,9 @@ THE SOFTWARE.
description="${%if not empty, only up to this number of builds have their artifacts retained}" field="artifactNumToKeepStr">
<f:number clazz="positive-number" min="1" step="1" />
</f:entry>
<f:entry title="${%Remove last stable and successful builds}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about these? The label seems too tied to the developer writing code instead of from a user perspective imo.

Suggested change
<f:entry title="${%Remove last stable and successful builds}"
<f:entry title="${%Remove last build}"

or

Suggested change
<f:entry title="${%Remove last stable and successful builds}"
<f:entry title="${%Remove last successful build}"

successful is still a bit confusing as 'unstable' is successful from my reading of the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Picked the shorter option, more clear to me as developer :)

Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@timja timja requested a review from NotMyFault July 11, 2024 17:51
@daniel-beck
Copy link
Member

Weak -0.5 as this does not appear to be a common use case and is better off being done in a plugin.

@NotMyFault
Copy link
Member

/label ready-for-merge


This PR is now ready for merge. We will merge it after ~24 hours if there is no negative feedback.
Please see the merge process documentation for more information about the merge process.
Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Aug 13, 2024
@NotMyFault NotMyFault merged commit b064be0 into jenkinsci:master Aug 21, 2024
16 checks passed
Copy link

welcome bot commented Aug 21, 2024

Congratulations on getting your very first Jenkins core pull request merged 🎉🥳

This is a fantastic achievement, and we're thrilled to have you as part of our community! Thank you for your valuable input, and we look forward to seeing more of your contributions in the future!

We would like to invite you to join the community chats and forums to meet other Jenkins contributors 😊
Don't forget to check out the participation page to learn more about how to contribute to Jenkins.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants